﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SavannaFrame.Classes;

namespace SavannaFrame
{
    public partial class MarkerEditFull : UserControl
    {
        Slot slot;
        MarkerEdit leftEdit;
        MarkerEdit rightEdit;

        public MarkerEditFull(Slot slot)
        {
            this.slot = slot;
            leftEdit = new MarkerEdit(slot);
            leftEdit.Dock = DockStyle.Fill;
            rightEdit = new MarkerEdit(slot);
            rightEdit.Dock = DockStyle.Fill;

            InitializeComponent();

            splitContainer1.Panel1.Controls.Add(leftEdit);
            splitContainer1.Panel2.Controls.Add(rightEdit);

            cmbOperation.SelectedIndex = 0;
        }

        string getOperation()
        {
            return cmbOperation.SelectedItem.ToString();
        }

        public string GetMarker()
        {
            string result = null;
            if (chbEnableMarker.Checked)
                result = leftEdit.GetMarker() + getOperation() + rightEdit.GetMarker();
            return result;
        }

        private void MarkerEditFull_Load(object sender, EventArgs e)
        {

        }

        private void chbEnableMarker_CheckedChanged(object sender, EventArgs e)
        {
            panelOperation.Enabled = splitContainer1.Enabled = chbEnableMarker.Checked;
        }
    }
}
